package com.ysd.lis.controller.lab;


import com.ysd.common.Result;
import com.ysd.common.dto.DeletesDto;
import com.ysd.lis.annotation.LogDetail;
import com.ysd.lis.aspect.OperationType;
import com.ysd.lis.controller.pub.BaseController;
import com.ysd.lis.entity.lab.LabItemDictSpecialRules;
import com.ysd.lis.service.lab.LabItemDictSpecialRulesService;
import com.ysd.lis.service.lab.LabItemDictSpecialRulesService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 报告项目特殊规则 前端控制器
 * </p>
 *
 * @author pengchong
 * @since 2024-01-22
 */
@RestController
@RequestMapping("/lab/itemDictSpecialRules")
public class LabItemDictSpecialRulesController extends BaseController {
    @Autowired
    private LabItemDictSpecialRulesService labItemDictSpecialRulesService;

    @ApiOperation("获取特殊规则信息")
    @GetMapping("/findItemDictSpecialRules")
    public Result findItemDictRefer(LabItemDictSpecialRules labItemDictSpecialRules) {
        return labItemDictSpecialRulesService.findItemDictSpecialRules(labItemDictSpecialRules);
    }

    @ApiOperation("添加特殊规则")
    @PostMapping("/addItemDictSpecialRules")
    @LogDetail(requestParam ="addItemDictRefer",operationType = OperationType.INSERT, module = "检验管理" , businessName = "itemDictName",content = "新增【itemDictName】特殊规则操作")
    public Result addItemDictRefer(@RequestBody LabItemDictSpecialRules labItemDictSpecialRules){
        return labItemDictSpecialRulesService.addItemDictSpecialRules(labItemDictSpecialRules);
    }

    @ApiOperation("修改特殊规则")
    @PostMapping("/editItemDictSpecialRules")
    @LogDetail(requestParam ="editItemDictRefer",operationType = OperationType.UPDATE, module = "检验管理", businessName = "itemDictName", content = "修改【itemDictName】特殊规则操作")
    public Result editItemDictRefer(@RequestBody LabItemDictSpecialRules labItemDictSpecialRules){
        return labItemDictSpecialRulesService.editItemDictSpecialRules(labItemDictSpecialRules);
    }

    @ApiOperation("删除特殊规则")
    @PostMapping("/deleteItemDictSpecialRules")
    @LogDetail(requestParam ="deleteItemDictRefer",operationType = OperationType.UPDATE, module = "检验管理", businessName = "itemDictName", content = "修改【itemDictName】特殊规则操作")
    public Result deleteItemDictRefer(@RequestBody DeletesDto deletesDto){
        return labItemDictSpecialRulesService.deleteItemDictSpecialRules(deletesDto);
    }

}
